import {ShopType} from "@/Game/Shop";

export class CustomerClass {
    ID: number = -1;
    Name: string;
    Description: string;
    Consumption: number;
    Destinations: ShopType[];
    Fund: number = 0;

    constructor(name: string, consumption: number, destinations: ShopType[], description: string) {
        this.Name = name;
        this.Description = description;
        this.Consumption = consumption;
        this.Destinations = destinations;
    }
}

class ServantGirl extends CustomerClass {
    constructor(id: number) {
        super("丫鬟", 4, [ShopType.BookShop, ShopType.ClothShop], "念尔辛勤岁已深，乱离相失又相寻。<br/>他年待我门如市，报尔千金与万金。");
        this.ID = id;
    }
}

class CaptainClass extends CustomerClass {
    constructor(id: number) {
        super("都头", 3, [ShopType.Theatre, ShopType.GamblingHouse, ShopType.CujuField, ShopType.StorytellingHouse], "百人为都，置正副都头二人，节级四人。");
        this.ID = id;
    }
}

class YoungGentleman extends CustomerClass {
    constructor(id: number) {
        super("公子", 2, [ShopType.Theatre, ShopType.Pub, ShopType.GamblingHouse, ShopType.CujuField, ShopType.DivinationShop], "翩翩我公子，机巧忽若神。");
        this.ID = id;
    }
}

class Lyricist extends CustomerClass {
    constructor(id: number) {
        super("词人", 2, [ShopType.BookShop, ShopType.ClothShop, ShopType.Pub, ShopType.StorytellingHouse, ShopType.DivinationShop], "笔落惊风雨，诗成泣鬼神。");
        this.ID = id;
    }
}

class Matchmaker extends CustomerClass {
    constructor(id: number) {
        super("媒人", 3, [ShopType.Teahouse, ShopType.Theatre, ShopType.DivinationShop, ShopType.JewelryStore], "若能渡得天仙配，不枉吾发月老吟。");
        this.ID = id;
    }
}

class Coachman extends CustomerClass {
    constructor(id: number) {
        super("车夫", 4, [ShopType.Teahouse, ShopType.CujuField], "香车宝马照九陌，家家花下扶醉人。");
        this.ID = id;
    }
}

class WetNurse extends CustomerClass {
    constructor(id: number) {
        super("乳娘", 4, [ShopType.BookShop, ShopType.JewelryStore], "平生所负恩，不独一乳母。<br/>长恨富贵迟，遂令惭惭久。");
        this.ID = id;
    }
}

class Farmer extends CustomerClass {
    constructor(id: number) {
        super("农夫", 4, [ShopType.Pub, ShopType.GamblingHouse], "春种一粒粟，秋收万颗子。");
        this.ID = id;
    }
}

class CourtPainter extends CustomerClass {
    constructor(id: number) {
        super("宫廷画师", 2, [ShopType.Theatre, ShopType.StorytellingHouse, ShopType.PorcelainShop, ShopType.DivinationShop, ShopType.JewelryStore], "远看山有色，近听水无声。<br/>春去花还在，人来鸟不惊。");
        this.ID = id;
    }
}

class General extends CustomerClass {
    constructor(id: number) {
        super("将军", 2, [ShopType.Theatre, ShopType.Pub, ShopType.CujuField, ShopType.StorytellingHouse, ShopType.PorcelainShop], "马作的卢飞快，弓如霹雳弦惊。");
        this.ID = id;
    }
}

class FlowerGirl extends CustomerClass {
    constructor(id: number) {
        super("游商", 4, [ShopType.PorcelainShop, ShopType.JewelryStore], "小楼一夜听春雨，深巷明朝卖杏花。");
        this.ID = id;
    }
}

class Scholar extends CustomerClass {
    constructor(id: number) {
        super("书生", 4, [ShopType.Teahouse, ShopType.StorytellingHouse], "粗缯大布裹生涯，腹有诗书气自华。");
        this.ID = id;
    }
}

class CountyMagistrate extends CustomerClass {
    constructor(id: number) {
        super("县令", 3, [ShopType.Teahouse, ShopType.BookShop, ShopType.Pub, ShopType.PorcelainShop], "蒌藤接室公庭静，茉莉编篱别院香。<br/>一片冰心向南海，谁知岭表是炎方。");
        this.ID = id;
    }
}

class FemaleCook extends CustomerClass {
    constructor(id: number) {
        super("厨娘", 3, [ShopType.BookShop, ShopType.Pub, ShopType.PorcelainShop, ShopType.SyrupShop], "织手搓来玉色匀，碧油煎出嫩黄深。");
        this.ID = id;
    }
}

class HanlinAcademician extends CustomerClass {
    constructor(id: number) {
        super("翰林学士", 2, [ShopType.BookShop, ShopType.Theatre, ShopType.Pub, ShopType.CujuField, ShopType.StorytellingHouse], "状元及第金科律，文韬武略帅英才。");
        this.ID = id;
    }
}

class Shopkeeper extends CustomerClass {
    constructor(id: number) {
        super("掌柜", 2, [ShopType.Teahouse, ShopType.ClothShop, ShopType.GamblingHouse, ShopType.CujuField, ShopType.SyrupShop], "店主，你知不知道，我这店，有四千两银子。");
        this.ID = id;
    }
}

class RichMerchant extends CustomerClass {
    constructor(id: number) {
        super("富商", 2, [ShopType.Theatre, ShopType.Pub, ShopType.CujuField, ShopType.PorcelainShop, ShopType.DivinationShop], "君子爱财，取之有道。");
        this.ID = id;
    }
}

class Madam extends CustomerClass {
    constructor(id: number) {
        super("夫人", 2, [ShopType.Teahouse, ShopType.ClothShop, ShopType.PorcelainShop, ShopType.JewelryStore, ShopType.SyrupShop], "高鬟粉项商人妇，不识人间离别愁。");
        this.ID = id;
    }
}

class Painter extends CustomerClass {
    constructor(id: number) {
        super("画师", 3, [ShopType.Teahouse, ShopType.BookShop, ShopType.CujuField, ShopType.JewelryStore], "胸藏天巧锦云梭，万象都收入网罗。<br/>只作虫鱼非磊落，安排手笔写山河。");
        this.ID = id;
    }
}

class Craftsman extends CustomerClass {
    constructor(id: number) {
        super("匠人", 4, [ShopType.GamblingHouse, ShopType.SyrupShop], "华夏从来匠人多，情怀悠悠默无闻。");
        this.ID = id;
    }
}

class Patrol extends CustomerClass {
    constructor(id: number) {
        super("衙役", 4, [ShopType.Pub, ShopType.Theatre], "夜投石壕村，有吏夜捉人。");
        this.ID = id;
    }
}

class Singer extends CustomerClass {
    constructor(id: number) {
        super("小唱", 4, [ShopType.JewelryStore, ShopType.SyrupShop], "佳娘捧板花钿簇，唱出新声群艳伏。");
        this.ID = id;
    }
}

class Midwife extends CustomerClass {
    constructor(id: number) {
        super("稳婆", 3, [ShopType.ClothShop, ShopType.GamblingHouse, ShopType.StorytellingHouse, ShopType.SyrupShop], "羊水血泊拈蒂落, 喜将生命接迎。");
        this.ID = id;
    }
}

class Fisherman extends CustomerClass {
    constructor(id: number) {
        super("渔夫", 4, [ShopType.Pub, ShopType.DivinationShop], "竹丝篮里白鱼肥，<br/>日落江头换酒归。");
        this.ID = id;
    }
}

class Broker extends CustomerClass {
    constructor(id: number) {
        super("牙人", 4, [ShopType.Theatre, ShopType.GamblingHouse, ShopType.CujuField, ShopType.DivinationShop], "牙郎当作互郎，主互市事也。<br/>唐人书互作牙，转为牙耳");
        this.ID = id;
    }
}

class Butler extends CustomerClass {
    constructor(id: number) {
        super("管家", 3, [ShopType.BookShop, ShopType.Pub, ShopType.DivinationShop, ShopType.JewelryStore], "半年辛苦葺荒居，不独单寒腹亦虚。</br>努力且为田舍客，他年为尔觅金鱼。");
        this.ID = id;
    }
}

class Star extends CustomerClass {
    constructor(id: number) {
        super("名角", 2, [ShopType.Teahouse, ShopType.ClothShop, ShopType.StorytellingHouse, ShopType.GamblingHouse, ShopType.JewelryStore], "曲罢曾教善才服，妆成每被秋娘妒。");
        this.ID = id;
    }
}

class Landlord extends CustomerClass {
    constructor(id: number) {
        super("员外", 2, [ShopType.ClothShop, ShopType.GamblingHouse, ShopType.PorcelainShop, ShopType.DivinationShop, ShopType.JewelryStore], "直到闭关朝谒去，莺声不散柳含烟");
        this.ID = id;
    }
}

class Woodcutter extends CustomerClass {
    constructor(id: number) {
        super("樵夫", 4, [ShopType.SyrupShop, ShopType.DivinationShop], "一担乾柴古渡头，盘缠一日颇优游。<br/>归来涧底磨刀斧，又作全家明日谋。");
        this.ID = id;
    }
}

class Doctor extends CustomerClass {
    constructor(id: number) {
        super("郎中", 3, [ShopType.SyrupShop, ShopType.BookShop, ShopType.StorytellingHouse, ShopType.PorcelainShop], "古人医在心，心正药自真。");
        this.ID = id;
    }
}

class Actress extends CustomerClass {
    constructor(id: number) {
        super("艺人", 3, [ShopType.ClothShop, ShopType.CujuField, ShopType.StorytellingHouse, ShopType.SyrupShop], "空中几处闻清响，欲绕行云不遣飞。");
        this.ID = id;
    }
}

class Candidate extends CustomerClass {
    constructor(id: number) {
        super("举子", 3, [ShopType.Teahouse, ShopType.BookShop, ShopType.Theatre, ShopType.JewelryStore], "春风得意马蹄疾，一日看尽长安花");
        this.ID = id;
    }
}

class Daughter extends CustomerClass {
    constructor(id: number) {
        super("千金", 2, [ShopType.ClothShop, ShopType.Theatre, ShopType.GamblingHouse, ShopType.CujuField, ShopType.SyrupShop], "待字闺中群芳妒，未语先羞惹人怜");
        this.ID = id;
    }
}

class Diviner extends CustomerClass {
    constructor(id: number) {
        super("卦师", 3, [ShopType.BookShop, ShopType.GamblingHouse, ShopType.PorcelainShop, ShopType.SyrupShop], "批阴阳断五行，看掌中日月。<br/>测风水堪六合，拿袖中乾坤。");
        this.ID = id;
    }
}

class Taoist extends CustomerClass {
    constructor(id: number) {
        super("道士", 4, [ShopType.ClothShop, ShopType.GamblingHouse], "吟依古柏天风断，啸近倦坛海月高。");
        this.ID = id;
    }
}

class PrefectureMagistrate extends CustomerClass {
    constructor(id: number) {
        super("知府", 4, [ShopType.Teahouse, ShopType.BookShop, ShopType.StorytellingHouse, ShopType.PorcelainShop, ShopType.SyrupShop], "识破人间伪与真，自怜扰扰百年身。");
        this.ID = id;
    }
}

export function instantiateAllCustomers(repeat: number = 1, startID: number = 0): CustomerClass[] {
    let result: CustomerClass[] = [];
    if (repeat > 0) {
        for (let i = 0; i < repeat; i++) {
            result.splice(result.length - 1, 0, new ServantGirl(startID++), new CaptainClass(startID++), new YoungGentleman(startID++), new Lyricist(startID++), new Matchmaker(startID++), new Coachman(startID++), new WetNurse(startID++), new Farmer(startID++), new CourtPainter(startID++), new General(startID++), new FlowerGirl(startID++), new Scholar(startID++), new CountyMagistrate(startID++), new FemaleCook(startID++), new HanlinAcademician(startID++), new Shopkeeper(startID++), new RichMerchant(startID++), new Madam(startID++), new Painter(startID++), new Craftsman(startID++), new Patrol(startID++), new Singer(startID++), new Midwife(startID++), new Fisherman(startID++), new Broker(startID++), new Butler(startID++), new Star(startID++), new Landlord(startID++), new Woodcutter(startID++), new Doctor(startID++), new Actress(startID++), new Candidate(startID++), new Daughter(startID++), new Diviner(startID++), new Taoist(startID++), new PrefectureMagistrate(startID++));
        }
    }
    return result;
}